#pragma once
#include <vector>
#include "Singleton.h"

#define NUMVERTICES 4
#define NUMINDICES  6

struct RectPointVertex
{
    DirectX::XMFLOAT3 position;
    DirectX::XMFLOAT2 textureCoordinate;
};

struct GlobalConstantBuffer
{
	float4x4 view;
	float4x4 projection;
};

struct SpriteConstantBuffer
{
	float4x4 world;
};


enum MyEnum
{
	VD_BASE = 0,
	VD_TYPE_COUNT
};

ref class RenderDeclaration :public SingletonRef<RenderDeclaration>
{
	friend SingletonRef;
private:
	RenderDeclaration();

internal:

	void Initialize();

	Microsoft::WRL::ComPtr<ID3D11SamplerState>			GetSampler();

	Microsoft::WRL::ComPtr<ID3D11InputLayout>			GetInputLayout();

	Microsoft::WRL::ComPtr<ID3D11VertexShader>			GetVertexShader();

	Microsoft::WRL::ComPtr<ID3D11PixelShader>			GetPixelShader();

	Microsoft::WRL::ComPtr<ID3D11Buffer>				GetSpriteVertexBuffer();
	
	Microsoft::WRL::ComPtr<ID3D11Buffer>				GetSpriteIndexBuffer();

	Microsoft::WRL::ComPtr<ID3D11Buffer>				GetConstantBufferGlobal();
	
	const D3D11_SUBRESOURCE_DATA&						GetRectVertexDeclData();

	const D3D11_SUBRESOURCE_DATA&						GetRectIndexDeclData();
	
private:
	

	std::vector<RectPointVertex> 						m_subresource_vertex_vector;
	D3D11_SUBRESOURCE_DATA								m_init_vertex_Data;
	std::vector<uint16> 								m_subresource_index_vector;
	D3D11_SUBRESOURCE_DATA								m_init_index_Data;

	
	Microsoft::WRL::ComPtr<ID3D11InputLayout>           m_inputLayout_base;
	Microsoft::WRL::ComPtr<ID3D11VertexShader>          m_vertexShader_base;
	Microsoft::WRL::ComPtr<ID3D11PixelShader>           m_pixelShader_base;
	Microsoft::WRL::ComPtr<ID3D11SamplerState>          m_sampler_base;

	Microsoft::WRL::ComPtr<ID3D11Buffer>                m_spritevertexBuffer;             
	Microsoft::WRL::ComPtr<ID3D11Buffer>                m_spriteindexBuffer;   
	Microsoft::WRL::ComPtr<ID3D11Buffer>                m_constantBufferGlobal;
};